package com.sl.au.service.impl;
/**
 * 应收帐节点查询
 * zty
 * 2017-02-20
 */
import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sl.au.entity.EXDEPaymentNodeInfo;
import com.sl.au.entity.EXDEPaymentNodeInfoTQ;
import com.sl.au.service.EXDEPaymentNodeService;


@Service("EXDEPaymentNodeService")
@Transactional
public class EXDEPaymentNodeServiceImpl extends BaseServiceImpl implements EXDEPaymentNodeService<Object, Object>{
	@PersistenceContext
	private EntityManager em;
	/*
	 *调用存储过程MonthAccountsReceivable
	 */
	@Override
	public List<EXDEPaymentNodeInfo> getMyPage(String MonthYearDate) {//
		
		Query query = this.em.createNativeQuery("{call MonthAccountsReceivable (?)}",EXDEPaymentNodeInfo.class);//存储过程的名称
		System.out.println(MonthYearDate);
		query.setParameter(1, MonthYearDate);
		@SuppressWarnings("unchecked")
		List<EXDEPaymentNodeInfo> users = query.getResultList();
		return users;
	
	}
	/*
	 *调用存储过程MonthAccountsReceivableTQ,
	 */
	@Override
	public List<EXDEPaymentNodeInfoTQ> getMyPageTQ(String ReceivableTQDate) {
		
		Query queryTQ = this.em.createNativeQuery("{call MonthAccountsReceivableTQ(?)}",EXDEPaymentNodeInfoTQ.class);//存储过程的名称
		System.out.println(ReceivableTQDate);
		queryTQ.setParameter(1, ReceivableTQDate);
		@SuppressWarnings("unchecked")
		List<EXDEPaymentNodeInfoTQ> usersTQ = queryTQ.getResultList();
		return usersTQ;

	}
}
